Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements basic validation for
start
,stop
,tol
, andwidths
.When invalid input is encountered an exception will be thrown.
Specifically, a
InvalidArgumentException
is thrown detailing the errorstate that has occurred.
We debated whether or not to throw exceptions in a few cases;
ultimately we have decided that error states should be clearly
defined and handled (both for us internally and for users).
What this means is that, in a few cases, our library will
throw
which results in callers being immediately alerted of the error
state that caused the exception to be thrown (so that errors are
not propagated silently throughout application code).
This is an added layer of safety to help ensure code that depends
on this library remains correct (w.r.t. it's usage of this library).
In short, the validation we are doing here says that callers:
widths
start > stop
tol
erance values, e.g.0.00001
We consider these constraints to be reasonable and empowering
rather than limiting. That is, this kind of validation helps guard
against typos, e.g.